package api

import (
	"github.com/labstack/echo/v4"
	"longmen/server/pkg/common/helper/const"
	utils2 "longmen/server/pkg/common/helper/util"
	"longmen/server/pkg/common/services"
)

// @Summary 禮物列表
// @Description 禮物列表
// @Accept  json
// @Produce  json
// @Tags Gift
// @Success 200 {object} models_main.Gift "result"
// @Router /api/gift/getGiftList [POST]
func (base *Controller) GetGiftList(c echo.Context) error {
	gifts, err := services.GetGiftList()
	if err != nil {
		return utils2.BuildFail(c, 1, "", err)
	}
	return utils2.BuildSuccess(c, gifts, "")
}

// @Summary 含折扣禮物列表
// @Description 含折扣禮物列表 暂时未有
// @Accept  json
// @Produce  json
// @Tags Gift
// @Success 200 {object} models_main.Gift "result"
// @Router /api/gift/getGiftListNew [POST]
func (base *Controller) GetGiftListNew(c echo.Context) error {
	uid, _ := c.Get(_const.HTTP_KEY_UID).(int)
	gifts, err := services.GetGiftListNew(uid)
	if err != nil {
		return utils2.BuildFail(c, 1, "", err)
	}
	return utils2.BuildSuccess(c, gifts, "")
}
